<?php
include "../config/config.inc.php";
//connect to mysql database
mysql_connect($host,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");

$query="SELECT id FROM bids ORDER BY id DESC";
$result=mysql_query($query);

$id=mysql_result($result,0,"id");

$id++;

$sql="INSERT INTO bids (BID_id, Project, location, bid_date, bid_amount, bid_alternates, General_con, comment, id, city)
VALUES
('".$_POST[bidder] ."".$id ."9','$_POST[project]','$_POST[location]','$_POST[biddate]','$_POST[bidamount]','$_POST[altamount]','$_POST[gc]','$_POST[comments]','$id', '$_POST[city]')";

if (!mysql_query($sql))
  {
  die('Error: ' . mysql_error());
  }
echo "1 record added</br>";
echo "Bid ID: ".$_POST[bidder] ."".$id ."9</br>";

mysql_close($con);
?> 

<script type="text/javascript">
<!--
window.location = "/details.php?bidid=<?php echo "".$_POST[bidder] ."".$id ."9"; ?>"
//-->
</script>